#ifndef LONGKEY_COMMON_SECURITY_MD5_H__
#define LONGKEY_COMMON_SECURITY_MD5_H__

#include "inttypes.h"
#include "hash-internal.h"

#ifdef __cplusplus
extern "C" {
#endif // __cplusplus

	typedef HASH_CTX MD5_CTX;

	void MD5_init(MD5_CTX* ctx);
	void MD5_update(MD5_CTX* ctx, const void* data, int len);
	const uint8_t* MD5_final(MD5_CTX* ctx);

	// Convenience method. Returns digest address.
	const uint8_t* MD5(const void* data, int len, uint8_t* digest);

#define MD5_DIGEST_SIZE 16

#ifdef __cplusplus
}
#endif // __cplusplus

#endif  // LONGKEY_COMMON_SECURITY_MD5_H__
